package com.jizhang.service.impl;

import com.jizhang.base.model.BaseModel;
import com.jizhang.entity.Cate;
import com.jizhang.mapper.CateMapper;
import com.jizhang.service.CateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 郭博民
 * @since 2022-07-15
 */
@Service
public class CateServiceImpl extends ServiceImpl<CateMapper, Cate> implements CateService {
    @Autowired
    CateMapper cateMapper;

    // 查询所有cate
    public BaseModel findCate(BaseModel baseModel) throws Exception {
        List<Cate> cateList= cateMapper.findCate();
        System.out.println("所有的分类:"+cateList);
        baseModel.setCode(0);
        baseModel.setMessage("分类查询成功");
        baseModel.setData(cateList);
        return baseModel;
    }
}
